package cn.edu.just.firstjavaapp.l20;

import javax.swing.*;
import java.awt.*;

public class BorderLayoutDemo {
    public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.setBounds(100,100,400,300);

        JButton button1 = new JButton("按钮1");
        frame.add(button1,BorderLayout.NORTH);

        JButton button2 = new JButton("按钮2");
        frame.add(button2,BorderLayout.WEST);

        JButton button3 = new JButton("按钮3");
        frame.add(button3,BorderLayout.CENTER);

        JButton button4 = new JButton("按钮4");
        frame.add(button4,BorderLayout.SOUTH);

        frame.setVisible(true);
    }
}
